package demo.timer;

import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

import java.util.Date;
import java.util.Random;


public class TimerJob {

	@Scheduled(cron = "0 0 * * * *")
	public void reportTime() {
		System.out.println(new Date());
	}

	@Scheduled(initialDelay = 1000L, fixedDelayString = "10000")
	public void saySth() {
		System.out.println(new Random().nextInt(100));
	}

}
